package com.leo.train.business.service;

import com.leo.train.business.dto.DailySeatQueryDto;
import com.leo.train.business.dto.SeatSellDto;
import com.leo.train.business.entity.DailySeat;
import com.leo.train.business.vo.DailySeatVo;
import com.leo.train.business.vo.SeatSellVo;
import com.leo.train.common.resp.PageResult;

import java.util.Date;
import java.util.List;

public interface DailySeatService {
    /**
     * 保存
     * @param dailySeat
     */
    void save(DailySeat dailySeat);

    /**
     * 删除
     * @param id
     */
    void deleteById(Long id);

    /**
     * 查询座位列表
     * @param dailySeatQueryDto
     * @return
     */
    PageResult<DailySeatVo> list(DailySeatQueryDto dailySeatQueryDto);

    /**
     * 详情
     * @param id
     * @return
     */
    DailySeatVo detail(Long id);

    /**
     * 生成座位
     * @param trainCode
     */
    void generateSeats(String trainCode);

    /**
     * 根据当前日期和车次生成座位信息
     *  @param date 日期
     *  @param trainCode 车次编号
     */
    void genDaily(Date date, String trainCode);

    /**
     * 计算座位数量
     * @param date
     * @param trainCode
     * @param seatType
     * @return
     */
    int countSeat(Date date, String trainCode,String seatType);

    /**
     * 根据车厢索引查询座位
     * @param date
     * @param trainCode
     * @param carriageIndex
     * @return 座位
     */
    List<DailySeat> listByCarriage(Date date, String trainCode,Integer carriageIndex);

    /**
     * 查询座位销售情况
     * @param seatSellDto
     * @return
     */
    List<SeatSellVo> querySeatSell(SeatSellDto seatSellDto);
}
